﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LuvlyHealer2
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
            cure1enabled.Checked = Properties.Settings.Default.cure1enabled;
            cure2enabled.Checked = Properties.Settings.Default.cure2enabled;
            cure3enabled.Checked = Properties.Settings.Default.cure3enabled;
            cure4enabled.Checked = Properties.Settings.Default.cure4enabled;
            cure5enabled.Checked = Properties.Settings.Default.cure5enabled;
            cure6enabled.Checked = Properties.Settings.Default.cure6enabled;
            cure1amount.Value = Properties.Settings.Default.cure1amount;
            cure2amount.Value = Properties.Settings.Default.cure2amount;
            cure3amount.Value = Properties.Settings.Default.cure3amount;
            cure4amount.Value = Properties.Settings.Default.cure4amount;
            cure5amount.Value = Properties.Settings.Default.cure5amount;
            cure6amount.Value = Properties.Settings.Default.cure6amount;
            plReraise.Checked = Properties.Settings.Default.plReraise;
            if (Properties.Settings.Default.plReraiseLevel == 1)
            {
                plReraiseLevel1.Checked = true;
            }
            else if (Properties.Settings.Default.plReraiseLevel == 2)
            {
                plReraiseLevel2.Checked = true;
            }
            else if (Properties.Settings.Default.plReraiseLevel == 3)
            {
                plReraiseLevel3.Checked = true;
            }
            plRefresh.Checked = Properties.Settings.Default.plRefresh;
            if (Properties.Settings.Default.plRefreshLevel == 1)
            {
                plRefreshLevel1.Checked = true;
            }
            else if (Properties.Settings.Default.plRefreshLevel == 2)
            {
                plRefreshLevel2.Checked = true;
            }
            plsublimation.Checked = Properties.Settings.Default.sublimation;
            plafflatusSolace.Checked = Properties.Settings.Default.afflatusSolace;
            pllightArts.Checked = Properties.Settings.Default.lightArts;
            plHaste.Checked = Properties.Settings.Default.haste;
            plStoneskin.Checked = Properties.Settings.Default.stoneskin;
            plAquaveil.Checked = Properties.Settings.Default.aquaveil;
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }

        private void Save_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.cure1enabled = cure1enabled.Checked;
            Properties.Settings.Default.cure2enabled = cure2enabled.Checked;
            Properties.Settings.Default.cure3enabled = cure3enabled.Checked;
            Properties.Settings.Default.cure4enabled = cure4enabled.Checked;
            Properties.Settings.Default.cure5enabled = cure5enabled.Checked;
            Properties.Settings.Default.cure6enabled = cure6enabled.Checked;
            Properties.Settings.Default.cure1amount = Convert.ToInt32(cure1amount.Value);
            Properties.Settings.Default.cure2amount = Convert.ToInt32(cure2amount.Value);
            Properties.Settings.Default.cure3amount = Convert.ToInt32(cure3amount.Value);
            Properties.Settings.Default.cure4amount = Convert.ToInt32(cure4amount.Value);
            Properties.Settings.Default.cure5amount = Convert.ToInt32(cure5amount.Value);
            Properties.Settings.Default.cure6amount = Convert.ToInt32(cure6amount.Value);
            Properties.Settings.Default.lightArts = pllightArts.Checked;
            Properties.Settings.Default.afflatusSolace = plafflatusSolace.Checked;
            Properties.Settings.Default.sublimation = plsublimation.Checked;
            Properties.Settings.Default.plReraise = plReraise.Checked;
            Properties.Settings.Default.haste = plHaste.Checked;
            Properties.Settings.Default.stoneskin = plStoneskin.Checked;
            Properties.Settings.Default.haste = plHaste.Checked;
            Properties.Settings.Default.aquaveil = plAquaveil.Checked;
            if (plReraiseLevel1.Checked)
            {
                Properties.Settings.Default.plReraiseLevel = 1;
            }
            else if (plReraiseLevel2.Checked)
            {
                Properties.Settings.Default.plReraiseLevel = 2;
            }
            else if (plReraiseLevel3.Checked)
            {
                Properties.Settings.Default.plReraiseLevel = 3;
            }
            Properties.Settings.Default.plRefresh = plRefresh.Checked;
            if (plRefreshLevel1.Checked)
            {
                Properties.Settings.Default.plRefreshLevel = 1;
            }
            else if (plRefreshLevel2.Checked)
            {
                Properties.Settings.Default.plRefreshLevel = 2;
            }
            Properties.Settings.Default.Save();
            MessageBox.Show("Settings saved!", "Settings");
        }

    }
}
